/*
 * ParsedProgram.java - ScriptME
 * 
 * Copyright (c) 2009 Cesar Henriques <cesar at alttab.com.ar>.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v2.1
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Based on FESI Project
 * 
 * Contributors:
 * 	Jean-Marc Lugrin - initial API and implementation
 * 	Cesar Henriques <cesar at alttab.com.ar> - J2ME Porting and Extensions
 */
package org.scriptme.ecmascript.interpreter;

import java.util.Vector;

import org.scriptme.ecmascript.ast.ASTProgram;

/**
 * Represent a parsed program or function.
 */
public class ParsedProgram {
	// The parsed tree of the function
	/** The program node. */
	private ASTProgram programNode = null;
	// The list of declared variables
	/** The variable names. */
	private Vector variableNames = null;
	// The source of the parsed program
	/** The evaluation source. */
	private EvaluationSource evaluationSource = null;

	/**
	 * Create a parsed program representation from the abstract tree and list of
	 * variables.
	 * 
	 * @param programNode
	 *            the parsed program
	 * @param variableNames
	 *            The variables declared by var
	 * @param evaluationSource
	 *            the source of the parsed tree
	 */
	protected ParsedProgram(ASTProgram programNode, Vector variableNames,
			EvaluationSource evaluationSource) {
		this.programNode = programNode;
		this.variableNames = variableNames;
		this.evaluationSource = evaluationSource;
	}

	/**
	 * Get the program node.
	 * 
	 * @return the program node
	 */
	protected ASTProgram getProgramNode() {
		return programNode;
	}

	/**
	 * Get the variable list.
	 * 
	 * @return the variable list
	 */
	protected Vector getVariableNames() {
		return variableNames;
	}

	/**
	 * Get the evaluation souce.
	 * 
	 * @return the evaluation source
	 */
	protected EvaluationSource getEvaluationSource() {
		return evaluationSource;
	}
}
